package server;


import java.util.LinkedList;

import clientData.ForumDataInt;
import clientData.MemberDataInt;
import clientData.PostDataInt;
import clientData.TopicDataInt;
import exception.ElementNotFoundException;
import exception.ForumNotFoundException;
import exception.FriendNotFoundException;
import exception.LoggedInException;
import exception.NoPermissionException;
import exception.NotLoggedInException;
import exception.NotRegisteredException;
import exception.NotUserPostException;
import exception.PostNotExistException;
import exception.TopicNotFoundException;
import exception.UserNameExistException;


// TODO: Auto-generated Javadoc
/*
 * this interface should be the connection between the gui and the domain. 
 * in the interface there are all the methods needed to the user use cases.
 */
/**
 * The Interface ForumHandlerInt.
 */
public interface ForumHandlerInt extends java.rmi.Remote{

	/*
	 * registration use case- the user enters its details and the system registeres it in the system
	 * the system return true or false if the registration was good.
	 * the method will raise the right exception if nessesery.
	 * for example, if the user choose a userName that is already exist raise userExistExeption.
	 */
	/**
	 * Register.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param id the id
	 * @param email the email
	 * @param firstName the first name
	 * @param lastName the last name
	 * @throws UserNameExistException the user name exist exception
	 * @throws RemoteException the remote exception
	 * @throws Exception the exception
	 */
	public void register(String userName, String password, int id, String email, String firstName, String lastName) throws UserNameExistException,java.rmi.RemoteException, Exception ;
	
	/**
	 * Removes the post.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param forumId the forum id
	 * @param topicId the topic id
	 * @param postId the post id
	 */
	public void removePost(String userName, String password,int forumId, int topicId, int postId) throws java.rmi.RemoteException, TopicNotFoundException, ForumNotFoundException,PostNotExistException, NoPermissionException,NotLoggedInException;
	
	/**
	 * Removes the topic.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param forumId the forum id
	 * @param topicId the topic id
	 */
	public void removeTopic(String userName, String password,int forumId, int topicId) throws java.rmi.RemoteException;
	/*
	 * return the connection number.
	 * raise an exception if nessecery.
	 */
	/**
	 * Login.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @return the string
	 * @throws NotRegisteredException the not registered exception
	 * @throws RemoteException the remote exception
	 * @throws LoggedInException the logged in exception
	 */
	public String login(String userName, String password) throws NotRegisteredException,java.rmi.RemoteException, LoggedInException;
	/*
	 * raise an exception if nessecery.
	 */
	/**
	 * Logout.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @throws RemoteException the remote exception
	 */
	public void logout(String userName, String password)throws java.rmi.RemoteException;
	
	/**
	 * Adds the friend.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param friendUserName the friend user name
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws FriendNotFoundException the friend not found exception
	 */
	public void addFriend(String userName, String password, String friendUserName) throws NotLoggedInException,java.rmi.RemoteException, FriendNotFoundException;
	
	/**
	 * Removes the friend.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param friendUserName the friend user name
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws FriendNotFoundException the friend not found exception
	 */
	public void removeFriend(String userName, String password,String friendUserName) throws NotLoggedInException,java.rmi.RemoteException, FriendNotFoundException;
	
	/**
	 * Gets the user friends.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @return the user friends
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 */
	public LinkedList<MemberDataInt> getUserFriends(String userName, String password) throws NotLoggedInException,java.rmi.RemoteException;
	/*
	 * return a list of the forum names.
	 */
	/**
	 * Gets the forum list.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @return the forum list
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 */
	public LinkedList<ForumDataInt> getForumList(String userName, String password) throws NotLoggedInException,java.rmi.RemoteException;
	
	/**
	 * Creates the new topic in forum.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param forumId the forum id
	 * @param topicTitle the topic title
	 * @param postTitle the post title
	 * @param postContent the post content
	 * @throws NotLoggedInException the not logged in exception
	 * @throws ForumNotFoundException the forum not found exception
	 * @throws NoPermissionException the no permission exception
	 * @throws RemoteException the remote exception
	 */
	public void createNewTopicInForum(String userName, String password,int forumId, String topicTitle,String postTitle,String postContent) throws NotLoggedInException,ForumNotFoundException, NoPermissionException,java.rmi.RemoteException;
	
	/**
	 * Creates the forum.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param forumName the forum name
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws NoPermissionException the no permission exception
	 */
	public void createForum(String userName, String password, String forumName) throws NotLoggedInException,java.rmi.RemoteException, NoPermissionException;
	
	/**
	 * Test connection.
	 *
	 * @return the string
	 * @throws RemoteException the remote exception
	 */
	public String testConnection() throws java.rmi.RemoteException;

	/**
	 * Gets the forum topic list.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param forumId the forum id
	 * @return the forum topic list
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws ElementNotFoundException the element not found exception
	 */
	public LinkedList<TopicDataInt> getForumTopicList(String userName,String password, int forumId) throws NotLoggedInException,java.rmi.RemoteException, ElementNotFoundException;

	/**
	 * Gets the post list.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param topicId the topic id
	 * @param forumId the forum id
	 * @return the post list
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws ElementNotFoundException the element not found exception
	 */
	public LinkedList<PostDataInt> getPostList(String userName, String password,
			int topicId, int forumId) throws NotLoggedInException,java.rmi.RemoteException, ElementNotFoundException;

	/**
	 * Look for forum users.
	 *
	 * @param userNAme the user n ame
	 * @param password the password
	 * @param userNamePrefix the user name prefix
	 * @return the linked list
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws ElementNotFoundException the element not found exception
	 */
	public LinkedList<MemberDataInt> lookForForumUsers(String userNAme,String password, String userNamePrefix) throws NotLoggedInException,java.rmi.RemoteException, ElementNotFoundException ;

	/**
	 * Publish post in topic.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param topicId the topic id
	 * @param postTitle the post title
	 * @param forumId the forum id
	 * @param postContent the post content
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws TopicNotFoundException the topic not found exception
	 * @throws ForumNotFoundException the forum not found exception
	 */
	public void publishPostInTopic(String userName, String password, int topicId,
			String postTitle, int forumId, String postContent)
			throws NotLoggedInException,java.rmi.RemoteException, TopicNotFoundException, ForumNotFoundException;
	
	/**
	 * Edits the post.
	 *
	 * @param userName the user name
	 * @param password the password
	 * @param forumId the forum id
	 * @param TopicId the topic id
	 * @param postId the post id
	 * @param title the title
	 * @param content the content
	 * @throws NotLoggedInException the not logged in exception
	 * @throws RemoteException the remote exception
	 * @throws ForumNotFoundException the forum not found exception
	 * @throws TopicNotFoundException the topic not found exception
	 * @throws PostNotExistException the post not exist exception
	 * @throws NotUserPostException the not user post exception
	 */
	public void editPost(String userName, String password,int forumId,int TopicId, int postId, String title, String content) throws NotLoggedInException,java.rmi.RemoteException, ForumNotFoundException, TopicNotFoundException, PostNotExistException, NotUserPostException;
	
	
	/**
	 * Gets the notification msgs.
	 *
	 * @param userName the user name
	 * @return the notification msgs
	 * @throws RemoteException the remote exception
	 * @throws NotLoggedInException the not logged in exception
	 */
	public LinkedList<NotificationMsg> getNotificationMsgs(String userName) throws java.rmi.RemoteException, NotLoggedInException;
	
	/**
	 * Gets the notification msgs nb.
	 *
	 * @param userName the user name
	 * @return the notification msgs nb
	 * @throws RemoteException the remote exception
	 * @throws NotLoggedInException the not logged in exception
	 */
	public LinkedList<NotificationMsg> getNotificationMsgsNb(String userName) throws java.rmi.RemoteException, NotLoggedInException;
}
